#include <gtest/gtest.h>

int add(const int a, const int b) { return a + b; }

TEST(AddTest, Case1) {
    EXPECT_EQ(add(1, 2), 3) << "Case1: add(1, 2) should be 3";
}

testing::AssertionResult MyAddTest(const char* exp_a,
                                   const char* exp_b,
                                   const char* exp_res,
                                   const int a,
                                   const int b,
                                   const int res) {
    if (add(a, b) == res) {
        return testing::AssertionSuccess();
    }
    return testing::AssertionFailure()
           << "add(" << a << ", " << b << ") should be " << res;
}

TEST(AddTest, Case2) {
    EXPECT_PRED_FORMAT3(MyAddTest, 1, 2, 3);
    EXPECT_PRED_FORMAT3(MyAddTest, 3, 6, 8);
}